package controlebens.dao;

import java.sql.Connection;
import java.sql.SQLException;

/**
 * @author Jefferson Stachelski
 * Classe Abstract Dao, pai das classes de comunicação com o banco de dados
 */
public abstract class Dao {
    protected final Connection conexao;

    protected Dao(Connection conexao) {
        this.conexao = conexao;
    }
    
    protected void beginTransaction() throws SQLException{
        this.conexao.setSavepoint();
    }
    
    protected void rollbackTransaction() throws SQLException{
        this.conexao.rollback();
    }
    
    protected void commitTransaction() throws SQLException{
        this.conexao.commit();
    }
}
